<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>订单支付</title>

</head>
<body>
<!--头部开始-->
<!-- <div class="flowpay">
	<h2>支付</h2>
	<dl>
		<dd>
			本次订单需支付：<strong class="price">{$res['order_amount']}</strong>&nbsp;元
		</dd>
		<dd>
			<input type="button" value="微信支付" onclick="callpay();" />
		</dd>
	</dl>
</div> -->
<!--尾结束-->
</body>
<script type="text/javascript">
window.onload = function () {
            callpay();

        };

          var order_sn = "{$res['order_sn']}"; 
          var type = "{$type}"; 
          var orderid = "{$orderid}"; 
   function jsApiCall()
		{
			WeixinJSBridge.invoke(
				'getBrandWCPayRequest',
				<?php echo $jsApiParameters; ?>,
				function(res){
					WeixinJSBridge.log(res.err_msg);
					//alert(res.err_code+res.err_desc+res.err_msg);
					if (res.err_msg == 'get_brand_wcpay_request:ok') {
				//支付成功后跳转的地址
				var url='';
				if (type=='carry') {
					url='__MODULE__/shows/saveorder/id/'+orderid;
				}else if (type=='nocarry') {
					url='__MODULE__/show/saveorder/id/'+orderid;
				}else if (type=='pro') {
					url='__MODULE__/test/saveorder/id/'+orderid;
				}else{
					alert('未知错误');
				}
				location.href =url ;
			}


				}
			);
		}

function callpay(){
	if (typeof WeixinJSBridge == "undefined"){
	    if( document.addEventListener ){
	        document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
	    }else if (document.attachEvent){
	        document.attachEvent('WeixinJSBridgeReady', jsApiCall); 
	        document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
	    }
	}else{
	    jsApiCall();
	}
}
	




</script>
</html>